import time

from selenium import webdriver
from selenium.webdriver.common.by import By

option = webdriver.ChromeOptions()
#屏蔽自动化受控提示 && 开发者提示
option.add_experimental_option("excludeSwitches", ['enable-automation', 'load-extension'])

# 屏蔽'保存密码'提示框
prefs = {}
prefs["credentials_enable_service"] = False
prefs["profile.password_manager_enabled"] = False

option.add_experimental_option("prefs", prefs)
driver = webdriver.Chrome(options=option)
driver.get("http://www.baidu.com")
time.sleep(2)
driver.find_element(By.XPATH,'//*[@id="kw"]').send_keys('手机')
driver.find_element(By.XPATH,'//*[@id="su"]').click()
time.sleep(2)
js="var q=document.documentElement.scrollTop=10000"
driver.execute_script(js)
time.sleep(1)
js="var q=document.documentElement.scrollTop=0"
driver.execute_script(js)